package com.googlecode.rabbit_field;

public class Rabbit implements FieldObject {
	public static final int MAX_AGE = 100;
	public static final int INITIAL_STAMINA = 50;
	
	/**
	 * The current age of a rabbit. When it reaches MAX_AGE rabbit dies.
	 */
	private int age;
	
	/**
	 * A life-force of rabbit. Each move causes a rabbit to loose some of it. When rabbit eats it increases. When it is zero rabbit dies.
	 */
	private int stamina;
	
	/**
	 * Each rabbit can have name.
	 */
	private String name;
	
	/**
	 * The field rabbit lives on.
	 */
	private Field field;
	
	public Rabbit(String name, Field field) {
		this.name = name;
		this.field = field;
		stamina = INITIAL_STAMINA;
	}
	
	public void performAction() {
		adjustState();
	}
	
	/**
	 * 
	 */
	private void adjustState() {
		age++;
		
		if (age >= MAX_AGE || stamina <= 0) {
			// die
		}
	}
}
